<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="xm"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/base.css">
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/productdisplay.css">
<script type="text/javascript">
	function finderMer(id){
		location.href='<%=request.getContextPath()%>/merchandise?m=findMerById&id='+id;
		}
	function addCart(merId,price,sprice ){
		location.href='<%=request.getContextPath()%>/filter/cart?m=add&merId='+merId+'&price='+price+'&sprice='+sprice;
	}
</script>
</head>
<body>
	 <div id="box">
		 <jsp:include page="/comm/header.jsp"></jsp:include>
		 <div id="main">
		 	<div id="displayInfo">
		 		<div class="logoDiv">
		 			<xm:if test="${mer.special eq 1}">
		 			<img alt="" src="<%=request.getContextPath()%>/images/NewGoods_05.gif">	
		 			</xm:if>
		 			<xm:if test="${mer.special eq 0}">
		 			<img alt="" src="<%=request.getContextPath()%>/images/NewGoods_03.gif">	
		 			</xm:if>
		 			<xm:if test="${mer.special eq 2}">
		 			<img alt="" src="<%=request.getContextPath()%>/images/NewGoods_04.gif">	
		 			</xm:if>
		 		</div>
				<table>
					<tr class="bg_tr">
						<th>商品图片</th>
						<th>商品基本信息</th>
						<th class="desc">商品描述</th>
						<th>基本操作</th>
					</tr>
					<xm:forEach items="${merList }" var="mer">
						<tr>
						<td class="merTD">
							<img alt="" src="<%=request.getContextPath()%>${mer.picture }" >
						</td>
						<td>
							<a href="#">${mer.merName } </a><br>
							发售价格:${mer.price } <br>
							<xm:if test="${mer.special eq 1}">
								特价:${mer.sprice }<br>
							</xm:if>
							生产厂家:${mer.manufacturer } <br>
						</td>
						<td>
							${mer.merDesc }
						</td>
						<td>
							<img alt="" src="<%=request.getContextPath()%>/images/icon_car5.gif" onclick="finderMer(${mer.id})"><br>
							<br>
							<img alt="" src="<%=request.getContextPath()%>/images/icon_buy7.gif" onclick="addCart(${mer.id},${mer.price },${mer.sprice })">
						</td>
					</tr>
					<tr>
						<td colspan="4" class="line"></td>
					</tr>
					
					
					
					</xm:forEach>
				</table>
		 	</div>
		 </div>
		 <jsp:include page="/comm/footer.jsp"></jsp:include>
	 </div>
</body>
</html>